﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace SilkeyERP.UI.Entities.Shared
{
    public partial class ProductChooser : BaseChooser
    {
        public ProductChooser()
        {
            InitializeComponent();
        }

        public IQueryable<Model.Products> Query { get; set; }

        protected override void OnLoad()
        {
            this.Text = Properties.Resources.ProductChooserTitleForm;
            base.OnLoad();

            IQueryable<Model.Products> query = new BL.ProductsController().GetAll().AsQueryable();
            if (Query != null)
                query = Query;
            
            bsBaseChooser.DataSource = query.ToList();
        }
    }
}